package io.bdmc.modules.bss.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.bdmc.common.utils.MyMap;
import io.bdmc.common.utils.MyPage;
import io.bdmc.common.utils.R;
import io.bdmc.modules.bss.entity.DeviceMeasureEvent;
import io.bdmc.modules.bss.model.DeviceMeasureEventParam;
import io.bdmc.modules.bss.service.IDeviceMeasureEventService;
import io.bdmc.modules.sys.controller.AbstractController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ping
 * @since 2020-06-30
 */

// "每次的测量事件信息", description = "/bss/device/mevent")
@RestController
@RequestMapping("/bss/device/mevent")
public class DeviceMeasureEventController extends AbstractController {

	@Autowired
	IDeviceMeasureEventService _devicemeasureeventSvs;

	@RequestMapping("/list")
	@GetMapping(value = "分页查询测量事件")
	@RequiresPermissions("bss:device:mevent:list")
	// "分页查询每次的测量事件信息", notes = "每次的测量事件信息")
	public R list(DeviceMeasureEventParam params) {
		MyPage<DeviceMeasureEvent> myPage = new MyPage<DeviceMeasureEvent>(params.getCurrent(), params.getSize());
		MyPage<DeviceMeasureEvent> map = _devicemeasureeventSvs.mySelectPage(myPage, params);
		return R.ok().putData(MyMap.ok(map.getRecords(), map.getTotal()));

	}

}
